package com.ruoyi.client.pojo.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 修改密码参数表单
 */
@Data
@ApiModel(description = "修改密码参数")
public class UserUpdatePwdForm {

    @NotBlank(message = "原密码不能为空")
    @ApiModelProperty(value = "原密码", required = true, example = "123456")
    private String oldPassword;

    @NotBlank(message = "新密码不能为空")
    @Size(min = 6, max = 20, message = "新密码长度必须在6-20位之间")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$", message = "新密码必须包含数字和字母")
    @ApiModelProperty(value = "新密码（必须包含数字和字母，6-20位）", required = true, example = "Abc123456")
    private String newPassword;

    @NotBlank(message = "确认密码不能为空")
    @ApiModelProperty(value = "确认新密码", required = true, example = "Abc123456")
    private String confirmPassword;
}